const app = getApp()
export default {
  props: {
    width: {
      type: String,
      default: '100%'
    },
    type: {
      type: String,
      default: 'submit',
    },
    submitText: {
      type: String,
      default: '提交'
    },
    //左边按钮文字
    leftText: {
      type: String,
      default: '取消'
    },
    color: {
      type: String,
      default: '#fff'
    },
    //左边按钮文字样式
    customStyle: {
      type: [String, Object],
      default: '' || {}
    },
    height: {
      type: String,
      default: '80rpx'
    },
    margin: {
      type: String,
      default: '32rpx 0 42rpx'
    },
    radius: {
      type: String,
      default: '48rpx'
    },
    borderColor: {
      type: String,
      default: '#1c1f231A'
    },
    bgColor: {
      type: String,
      default: app.globalData.PRIMARY_COLOR
    },
    fontSize: {
      type: String,
      default: '28rpx'
    },
    leftPlain: {
      type: Boolean,
      default: false
    },
    //用于需要按钮点击需要处理的参数
    propsData: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
    }
  },
  watch: {
  },
  computed: {
  },
  mounted() {
  },
  methods: {
    getphonenumber(e) {
      this.$emit('phoneNumberChange', e.detail)
    },
    onTap(e) {
      const { type = '' } = e.currentTarget.dataset;
      if (type == 'cancel') { 
        this.$emit('handleLeft', { props: this.propsData })
      }else {
        this.$emit('handleTap', { props: this.propsData })
      }
    },
  }
}